package com.example.springbootsfzy.service.gengyifei;

import com.example.springbootsfzy.domain.CompanyInfo;
import com.example.springbootsfzy.mapper.CompanyInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/*
公司信息表 处理层
 */
@Service
public class company_info_service {
    @Autowired
    private CompanyInfoMapper companyInfoMapper;

    //查询公司所有信息
    public List<CompanyInfo> selectAll(){
        List<CompanyInfo> companyInfos = companyInfoMapper.selectAll();
        return companyInfos;
    }


    //动态添加公司信息
    public int insertSelective(CompanyInfo companyInfo){
        return companyInfoMapper.insertSelective(companyInfo);
    }


    //动态更改公司信息
    public int updateByPrimaryKeySelective(CompanyInfo companyInfo){
        return companyInfoMapper.updateByPrimaryKeySelective(companyInfo);
    }

    //通过主键删除公司信息
    public int deleteByPrimaryKey(int companyId){
       return companyInfoMapper.deleteByPrimaryKey(companyId);
    }
}
